import Vue from 'vue'
import VueRouter from 'vue-router'
import admin from './components/admin'

Vue.use(VueRouter);

export const routes = [
  /**
   * 单独页面
   */
  {
    path: '/',
    name: 'Login',
    redirect: '/login'
  },
  {
    path: '/login',
    name: 'Login',
    component: () => import('@/views/Login.vue')
  },
  {
    path: '/register',
    name: 'Register',
    component: () => import('@/views/Register.vue')
  },
    ...admin

];

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
});

export default router
